package edu.sctu.practice.class02.shilaihong.assign05.practice4;

/**
 * Created by admin on 2015/12/20.
 */
public class Class1 {
    public static void main (String args[]){
        int a[]={34,12,8,67,88,23,98,101,119,56};
        Sort_Demo m1=new Sort_Demo();
        Sub_Sort_Demo m2=new Sub_Sort_Demo();
        System.out.println("\n排序前的数据为：");
        for (int i=0;i<10;i++)
            System.out.print("  "+a[i]);
        m1.sort(a.length, a);
        System.out.println("\n按升序排列的数据为：");
        for (int i=0;i<10; i++)
            System.out.print(" " + a[i]); //调用子类中的sort()方法
        //调用父类中的sotr()方法,该方法实现了对父类中方法的覆盖
        m2.sort(a.length, a);
        System.out.println("\n按降序排列的数据为：");
                for (int i=0;i<10;i++){
                    System.out.print(" "+a[i]);
        }
    }
}
